<%-- 
  - Author: Neha Chauhan
  - Date: 13-Apr-'2011
  - Copyright Notice: TRAKHEES
  - Description: form.jsp
 --%>

<%@ include file="/WEB-INF/view/include.jsp"%>
<%@ page import="ae.pcfc.etks.online.web.*"%>

<c:if
	test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
	<script language="Javascript"
		src='<c:url value="/resources/js/ui/jquery.ui.datepicker-ar.js"/>'></script>
</c:if>

<script type="text/javascript">
	$().ready(function() {
		
		$("#strFromDate,#strToDate").datepicker({
			changeYear : true,
			changeMonth : true,
			dateFormat : 'dd/mm/yy',
			yearRange : '-50:+0',
			showButtonPanel : true,
			closeText : 'X'
		});

		
		$("#Report").validate({
			onfocusout:false,
			onkeyup:false,
			//onclick: false,			
			rules : {
				strFromDate : "required",
				strToDate : "required"
				
			},
			showErrors : function(errorMap, errorList) {

				var errors = '<ul>';
				var label;
				if (errorList.length) {
					$.each(errorMap, function(name, value) {
						label = $("label[for='" + name + "']").html();
						label = value + '[' + label + ']';
						errors = errors + '<li>' + label + '</li>';

					});
					errors = errors + '</ul>';
					jAlert('error', errors, 'Error Validating Form');
				}
			}
		});

	});
</script>



<div id="container" dir='<spring:message code="page.dir"/>'  align='<spring:message code="page.align"/>' class="t_fin-black-txt">


<form:form name="Report" id="Report" method="POST" 
		modelAttribute="<%=ConstantsAdmin.ADMIN_REPORT_MODEL_KEY %>">
		
		
		<spring:hasBindErrors
			name="<%=ConstantsAdmin.ADMIN_REPORT_MODEL_KEY %>">
			<script type="text/javascript">
				$(document)
						.ready(
								function() {
									jAlert(
											'error',
											'<li><form:errors path="*" delimiter="<li>"/>',
											'Error Validating Form');
								});
			</script>
		</spring:hasBindErrors>
		
		
	
	<fieldset>
			<legend><spring:message code="label.admin.report" /></legend>
	</fieldset>			
		<div class="t_form-left">
			<div class="fm-req">
					<form:label path="strReportType">
						<spring:message code="label.adminreport.type" /></form:label>
					<c:choose>
						<c:when
							test='${requestScope.requestContextAttribute.locale.language == "ar"}'>
							<form:select path="strReportType"
								items="${adminReportType}"
								id="strReportType" itemLabel="labelAr" itemValue="labelAr" cssStyle="width:220px;"  />
						</c:when>
						<c:otherwise>
							<form:select path="strReportType"
								items="${adminReportType}"
								id="strReportType" itemLabel="labelEn" itemValue="labelEn" cssStyle="width:220px;"  />
						</c:otherwise>
					</c:choose>
				</div>
				
							
		
		    
		  
		    <div class="fm-req">
					<form:label path="strFromDate">
					<spring:message code="label.adminreport.fromdate" /></form:label>
					<span id="dateInput"><form:input path="strFromDate" id="strFromDate" size="30"
						maxlength="100" /></span>
			</div>
					
			
						
		    <div class="fm-req">
					<form:label path="strToDate">
					<spring:message code="label.adminreport.todate" /></form:label>
					<span id="dateInput"><form:input path="strToDate" id="strToDate" size="30"
						maxlength="100" /></span>
			</div>
			
		    <br><br>
			
		<div id="fm-submit" class="fm-req">
			        <input type="submit" name="generate" value="<spring:message code="label.button.generate" />" class="t_btns submit"/>
					<input type="reset" name="reset" value="<spring:message code="label.button.reset" />" class="t_btns reset"/>
				
	
		</div>	
	</div>
	</form:form>
</div>
